import React, { useState } from 'react';
import {Button} from 'antd'
import BraftEditor from 'braft-editor'
import 'braft-editor/dist/index.css'
// cnpm install braft-editor
const Index = () => {

  const [htmlStr, setHtmlStr] = useState()
  return (
    <div>
      <Button onClick={()=>{
        console.log(htmlStr);
      }}>获取输入的内容</Button>

      <div dangerouslySetInnerHTML={{__html: htmlStr}}></div>

      <BraftEditor onChange={(e)=>{
        console.log(e.toHTML());
        setHtmlStr(e.toHTML())
      }} />
    </div>
  );
};

export default Index;
